function submitFormWithCaptcha() {
    // 直接生成一个验证码对象
    var captcha = new TencentCaptcha('1306253469', function (res) {
        console.log(res)
        // res（未通过验证）= {ret: 1, ticket: null}
        // res（验证成功） = {ret: 0, ticket: "String", randstr: "String"}
        if (res.ret === 0) {
            console.log("get form")
            var form = document.getElementById('form1');
            console.log("get ticket")
            var ticketInput = document.getElementById("ticket");
            console.log("get rnadstr")
            var randstrInput = document.getElementById("randStr");
            console.log(res.ticket)
            ticketInput.value = res.ticket;
            console.log("input randstr")
            randstrInput.value = res.randstr;
            console.log("submit")
            form.submit();

        }
        else
        {
            console.log("验证失败")
            alert("验证失败");
        }
    });
    // 显示验证码
    captcha.show();
}